#include "trap.h"
#include "../include/logic_test.h"
   .set noat
   .globl main
   .set noreorder
   .text
main:
   TEST_AND(0x00000000, 0xFFFFFFFF, 0x00000000) # 0 & 1
   TEST_AND(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF) # 1 & 1

   TEST_ANDI(0xFFFFFFFF, 0x0000FFFF, 0x0000FFFF) # 0 扩展

   TEST_LUI(0x0000FFFF, 0xFFFF0000)

   TEST_NOR(0x00000000, 0x00000000, 0xFFFFFFFF) # ~(0 | 0)
   TEST_NOR(0x00000000, 0xFFFFFFFF, 0x00000000) # ~(0 | 1)
   TEST_NOR(0xFFFFFFFF, 0xFFFFFFFF, 0x00000000) # ~(1 | 1)

   TEST_OR(0x00000000, 0x00000000, 0x00000000) # 0 | 0
   TEST_OR(0x00000000, 0xFFFFFFFF, 0xFFFFFFFF) # 0 | 1
   TEST_OR(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF) # 1 | 1

   TEST_ORI(0x00000000, 0x0000FFFF, 0x0000FFFF) # 0 扩展

   TEST_XOR(0x00000000, 0x00000000, 0x00000000) # 0 ^ 0
   TEST_XOR(0x00000000, 0xFFFFFFFF, 0xFFFFFFFF) # 0 ^ 1
   TEST_XOR(0xFFFFFFFF, 0xFFFFFFFF, 0x00000000) # 1 ^ 1

   TEST_XORI(0x00000000, 0x0000FFFF, 0x0000FFFF) # 0 扩展
   
   HIT_GOOD_TRAP

inst_error:
   HIT_BAD_TRAP
